﻿
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>工作</title>


<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
<link rel="shortcut icon"
	href="${pageContext.request.contextPath}/favicon.ico">
<!-- Animate.css -->
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/css/animate.css">
<!-- Icomoon Icon Fonts-->
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/css/icomoon.css">
<!-- Bootstrap  -->
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/css/bootstrap.css">

<link rel="stylesheet"
	href="${pageContext.request.contextPath}/css/style.css">

<!-- jQuery -->
<script src="${pageContext.request.contextPath}/js/jquery.min.js"></script>
<!-- jQuery Easing -->
<script src="${pageContext.request.contextPath}/js/jquery.easing.1.3.js"></script>
<!-- Bootstrap -->
<script src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script>
<!-- Waypoints -->
<script
	src="${pageContext.request.contextPath}/js/jquery.waypoints.min.js"></script>

<!-- Main JS (Do not remove) -->
<script src="${pageContext.request.contextPath}/js/main.js"></script>


<!-- Modernizr JS -->
<script
	src="${pageContext.request.contextPath}/js/modernizr-2.6.2.min.js"></script>
<!-- FOR IE9 below -->
<!--[if lt IE 9]>
	<script src="../js/respond.min.js"></script>
	<![endif]-->


<style type="text/css">
.content {
	text-align: center;
	color: forestgreen;
}

.content {
	margin-left: 20%;
}

.logo {
	width: 50px;
	height: 50px;
}
</style>



</head>
<body>
	<script>
		$(function() {

			$
					.ajax({
						url : "${pageContext.request.contextPath}/system/category/getAllCategory",
						type : "GET",
						dataType : "json",
						success : function(data) {
							//	$("#cate").val("8988");
							$("#cate").empty();
							for ( var i = 0; i < data.length; i++) {
								var cate = '<option  value="'+data[i].cid+'" >'
										+ data[i].p_category + '</option>';

								$("#cate").append(cate);

							}
							//  $("#cate").find("option[value="+data[1].cid+"]").prop("selected",true);
						},
						error : function() {
							alert("error");
						}

					});
		});

		$(document)
				.ready(
						function() {
							//设置异步提交成功的回调函数
							var options = {
								success : function(data) {
									window.location.href = "${pageContext.request.contextPath}/system/news/getAllNewsByPid";
								},
							};

							// 将表单异步化，
							$("#form1").ajaxForm(options);

						});
	</script>


	<div class="box-wrap">
		<header role="banner" id="fh5co-header">
			<div class="container">
				<nav class="navbar navbar-default">
					<div class="row">
						<div class="col-md-3">
							<div class="fh5co-navbar-brand">
								<a class="fh5co-logo"
									href="${pageContext.request.contextPath}/html/index.html">
									<img class="logo"
									src="${pageContext.request.contextPath}/images/logo.png"
									title="壁纸之家">
								</a>
							</div>
						</div>
						<div class="col-md-6">
							<ul class="nav text-center">
								<li><a
									href="${pageContext.request.contextPath}/system/news/toindex"><span>壁纸大全</span>
								</a>
								</li>
								<li><a
									href="${pageContext.request.contextPath}/system/news/toaddnews">壁纸添加</a>
								</li>
								<li><a
									href="${pageContext.request.contextPath}/system/news/toservice">壁纸分类</a>
								</li>
								<li class="active"><a
									href="${pageContext.request.contextPath}/system/news/tomynews">我的壁纸</a>
								</li>
							</ul>
						</div>
						<div class="col-md-3">
							<div class="fh5co-navbar-brand">
								<a href="${pageContext.request.contextPath}/system/user/tologin"
									title="登录"> LOGIN</a>
							</div>
						</div>
					</div>
				</nav>
			</div>
		</header>
		<!-- END: header -->
		<section id="intro">
			<div class="container">
				<div class="row">
					<div
						class="col-lg-6 col-lg-offset-3 col-md-8 col-md-offset-2 text-center">
						<div class="intro animate-box">
							<h2>更 多 精 美 壁 纸 尽 在 壁 纸 之 家</h2>
						</div>
					</div>
				</div>
			</div>
		</section>
		<section id="work">
			<div class="container">
				<div class="col-md-6 content">
					<div class="animate-box next">
						<div class="content" href="#">
							<div class="work-title">
								<form action="/NewsManager/system/news/updateNews"
									enctype="multipart/form-data" method="post" id="form1"
									class="bs-example bs-example-form">
									<input type="hidden" name="id" id="id" value="${news.id}"><br />

									<div class="input-group input-group-lg">
										<span class="input-group-addon glyphicon glyphicon-fire"></span>
										<input type="text" class="form-control" name="title"
											id="title" placeholder="标题:" value="${news.title}">
									</div>
									<br />
									<div class="input-group input-group-lg">
										<span class="input-group-addon glyphicon glyphicon-pencil"></span>
										<input type="text" class="form-control" name="content"
											id="content" placeholder="内容:" value="${news.content}">
									</div>
									<br />
									<div class="input-group input-group-lg">
										<span class="input-group-addon glyphicon glyphicon-tasks"></span>
										<select name="c_id" id="cate"
											style="width: 300px; margin-top: 10px;"></select>
									</div>
									<br />
									<div class="input-group input-group-lg">
										<img
											src="${pageContext.request.contextPath}/${news.urlpicture}"
											style="width:400px;height: 300px;">
									</div>
									<br />
									<div class="input-group input-group-lg">
										<span class="input-group-addon  glyphicon glyphicon-picture"></span>
										<input type="file" name="file"
											style="margin-left: 10px; margin-top: 5px;">
									</div>
									<br />

									<!-- <input type="button" value="上传" onclick="regist()" /> -->
									<button type="submit" class="btn btn-primary btn-lg btn-block">上传</button>

								</form>
							</div>
						</div>
					</div>
				</div>

			</div>
		</section>


		<footer id="footer" role="contentinfo">
			<div class="container">
				<div class="row">
					<div class="col-md-12 text-center ">
						<div class="footer-widget border">
							<p class="pull-left">
								<small>&copy;The home of the wallpaper</small>
							</p>
							<p class="pull-right">
								<small> Designed by <a href="#">WSG</a> The home of the
									wallpaper <a href="#" target="_blank">壁纸之家</a> - Worth having</small>
							</p>

						</div>
					</div>
				</div>
			</div>
		</footer>
	</div>
	<!-- END: box-wrap -->
</body>
</html>

